<!DOCTYPE html>
<html>
    <head>
        <meta content='' name='description'>
        <meta charset='UTF-8'>
        <meta content='True' name='HandheldFriendly'>
        <meta content='width=device-width, initial-scale=1.0' name='viewport'>
        <title><?php echo $title ?> - 管理后台 - <?php echo $settings['site_name'] ?></title>
        <?php $this->load->view('common/header-meta'); ?>
    </head>
    <body id="startbbs">
        <?php $this->load->view('common/header'); ?>

        <div class="container">
            <div class="row">

                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <ol class="breadcrumb">

                                <li class="active">用户列表</li>
                            </ol>
                            <ul class="nav nav-pills">
                                <li<?php if ($act == 'userlist' || $act == 'search') { ?> class="active"<?php } ?>><a href="<?php echo site_url('user/userlist'); ?>">用户列表</a></li>
                                <li<?php if ($act == 'shiminglist') { ?> class="active"<?php } ?>><a href="<?php echo site_url('user/shiminglist'); ?>">实名列表</a></li>
                            </ul>
                            <?php if ($act == 'userlist' || $act == 'search') { ?>
                                <table class='table table-hover table-condensed'>
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>昵称</th>
                                            <th>学院</th>
                                            <th>学号</th>
                                            <th>专业</th>
                                            <th>班级</th>
                                            <th>是否实名</th>
                                            <th>积分</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($users as $v) { ?>
                                            <tr id='user_<?php echo $v['uid'] ?>'>
                                                <td>
                                                    <?php echo $v['uid'] ?>
                                                </td>
                                                <td>
                                                    <strong><a href="<?php echo site_url('user/profile/' . $v['uid']); ?>" class="black startbbs profile_link" title="admin"><?php echo $v['username'] ?></a></strong>
                                                </td>

                                                <td>
                                                    <?php echo $xueyuan[$v['xueyuan']]; ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['xuehao'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['zhuanye'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['banji'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['shiming_str'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['credit'] ?>
                                                </td>
                                                <td class='center'>	
        <!--<a href="<?php echo site_url('admin/users/edit/' . $v['uid']); ?>" class="btn btn-primary btn-sm">修改</a>-->
                                                    <a href="<?php echo site_url('user/del/' . $v['uid']); ?>" class="btn btn-sm btn-danger">删除</a>
                                                </td>
                                            </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                                <?php if (@$pagination) { ?>
                                    <ul class='pagination'>
                                        <?php if ($act == 'index') echo $pagination ?>
                                    </ul>
                                <?php } ?>
                                <ul class='pagination'>
                                    <?php echo form_open('user/userlist', array('class' => 'form-inline')); ?>
                                    <input id="username" class="form-control" name="username" value="<?php echo $post_user_name; ?>" placeholder="用户昵称" type="text" />
                                    <div class="form-group">
                                        <label class="col-md-2 control-label">学院</label>
                                        <div class="col-md-5">
                                            <select class="form-control" name="xueyuan">
                                                <option value="">请选择学院</option>
                                                <?php foreach ($xueyuan as $key => $value) { ?>
                                                    <option value = "<?php echo $key; ?>"  <?php
                                                    if ($key == $post_xueyuan) {
                                                        echo "selected='selected'";
                                                    }
                                                    ?> >
                                                        <?php echo $value; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <input id="username" class="form-control" name="xuehao" placeholder="学号"  value="<?php echo $post_xuehao; ?>" type="text" />
                                    <button type="submit" name="commit" class="btn btn-default">搜索</button>
                                    </form>
                                </ul>
                            <?php } ?>

                            <?php if ($act == 'shiminglist') { ?>
                                <table class='table table-hover table-condensed'>
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>昵称</th>

                                            <th>学院</th>
                                            <th>学号</th>
                                            <th>专业</th>
                                            <th>班级</th>
                                            <th>是否实名</th>
                                            <th>积分</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($users as $v) { ?>
                                            <tr id='user_<?php echo $v['uid'] ?>'>
                                                <td>
                                                    <?php echo $v['uid'] ?>
                                                </td>
                                                <td>
                                                    <strong><a href="<?php echo site_url('user/profile/' . $v['uid']); ?>" class="black startbbs profile_link" title="admin"><?php echo $v['username'] ?></a></strong>
                                                </td>

                                                <td>
                                                    <?php echo $xueyuan[$v['xueyuan']]; ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['xuehao'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['zhuanye'] ?>
                                                </td> <td>
                                                    <?php echo $v['banji'] ?>
                                                </td>
                                                <td>
                                                    <?php echo $v['shiming_str'] ?>
                                                </td>
                                                <td>
                                                    <?php if (!empty($v['yikatong'])) { ?>            
                                                        <a href="<?php echo $v['yikatong']; ?>" target="xxx" class="black startbbs profile_link" title="admin"><img style="width:50px;height: 50px;" src="<?php echo $v['yikatong'] ?>"></a>
                                                    <?php } ?>            
                                                </td>
                                                <td class='center'>	
                                                    <?php if ($v['shimingzhuangtai'] == 1) { ?>            
                                                        <a href="<?php echo site_url('user/shimingPass/' . $v['uid']); ?>" class="btn btn-primary btn-sm">通过</a>
                                                        <a href="<?php echo site_url('user/shimingReject/' . $v['uid']); ?>" class="btn btn-sm btn-danger">驳回</a>
                                                    <?php } ?>            
                                                </td>
                                            </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                                <?php if (@$pagination) { ?>
                                    <ul class='pagination'>
                                        <?php if ($act == 'index') echo $pagination ?>
                                    </ul>
                                <?php } ?>
                                <ul class='pagination'>
                                    <?php echo form_open('user/shiminglist', array('class' => 'form-inline')); ?>
                                    <input id="username" class="form-control" name="username" value="<?php echo $post_user_name; ?>" placeholder="用户昵称" type="text" />

                                    <div class="form-group">
                                        <label class="col-md-2 control-label">学院</label>
                                        <div class="col-md-5">
                                            <select class="form-control" name="xueyuan">
                                                <option value="">请选择学院</option>
                                                <?php foreach ($xueyuan as $key => $value) { ?>
                                                    <option value = "<?php echo $key; ?>"  <?php
                                                    if ($key == $post_xueyuan) {
                                                        echo "selected='selected'";
                                                    }
                                                    ?> >
                                                        <?php echo $value; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">用户类型</label>
                                        <div class="col-md-5">
                                            <select class="form-control" name="gid">
                                                <option value="">请选择用户类型</option>
                                                <?php foreach ($group_type as $key => $value) { ?>
                                                    <option value = "<?php echo $key; ?>" 
                                                    <?php
                                                    if ($key == $post_gid) {
                                                        echo "selected='selected'";
                                                    }
                                                    ?>
                                                            >
                                                        <?php echo $value; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <input id="username" class="form-control" name="xuehao" placeholder="学号"  value="<?php echo $post_xuehao; ?>" type="text" />
                                    <button type="submit" name="commit" class="btn btn-default">搜索</button>
                                    </form>
                                </ul>
                            <?php } ?>

                        </div>
                    </div>
                </div><!-- /.col-md-8 -->

            </div><!-- /.row -->
        </div><!-- /.container -->

        <?php $this->load->view('common/footer'); ?>
    </body></html>